package com.contract.sql;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.javabean.contract.javaBeanZhuce;

public class getInfor {	
	public String[] select(javaBeanZhuce user){
		String[] list=new String[12];
		Connection conn=null;
		PreparedStatement ps=null;
		ResultSet rs=null;
		String sql="select * from classmate where name='"+user.getName()+"'";
		try {
			databaceManage DM=new databaceManage();	
			conn=DM.dbInit();
			ps=(PreparedStatement)conn.prepareStatement(sql);
			rs=ps.executeQuery();
			while(rs.next()){
			 list[0]=rs.getString("school");
			 list[1]=rs.getString("name");
			 list[2]=rs.getString("qq");
			 list[3]=rs.getString("wechat");
			 list[4]=rs.getString("youbian");
			 list[5]=rs.getString("mobilephone");
			 list[6]=rs.getString("email");
			 list[7]=rs.getString("unit");
			 list[8]=rs.getString("address");
			 list[9]=rs.getString("hometel");
			 list[10]=rs.getString("unittel");
			 list[11]=rs.getString("position");
			}
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return list;
		
	}
		
	}
